import { Injectable } from '@angular/core';
import {Observable} from "rxjs/Observable";
import {MsgResult} from "../../../../models/msg-result";
import {DamAPI} from "../../peach-constants";
import {RequestUtil} from "../../../../util/request-util";

@Injectable()
export class StartService {

  constructor(
    private requestUtil : RequestUtil
  ) { }

  //实时天气
  getRealWeatherData():Observable<MsgResult>{
    let params = "format=json&";
    return this.requestUtil.get(DamAPI.getRealWeatherData,params);
  }
  //实时AQI
  getRealAQIData():Observable<MsgResult>{
    let params = "format=json&";
    return this.requestUtil.get(DamAPI.getRealAQIData,params);
  }
  //初始化天气预报
  getWaterForecastData():Observable<MsgResult>{
    let params = "format=json&";
    return this.requestUtil.get(DamAPI.getWaterForecastData,params);
  }
  //当日累计AQI
  getCountAQIData():Observable<MsgResult>{
    let params = "format=json&";
    return this.requestUtil.get(DamAPI.getCountAQIData,params);
  }
  //年度目标
  getTargetChartData():Observable<MsgResult>{
    let params = "format=json&";
    return this.requestUtil.get(DamAPI.getTargetChartData,params);
  }
  //初始化图表
  getCityDataChart():Observable<MsgResult>{
    let params = "format=json&";
    return this.requestUtil.get(DamAPI.getCityDataChart,params);
  }
  //排名表格
  getRankingTable():Observable<MsgResult>{
    let params = "format=json&";
    return this.requestUtil.get(DamAPI.getRankingTable,params);
  }
}
